package pers.vic.practice.module.student.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import pers.vic.boot.base.controller.BaseController;

import pers.vic.practice.module.student.service.SClassesService;  
import pers.vic.practice.module.student.model.SClasses;

/**
 * @description:班级表 控制层
 * @author Vic.xu
 * @date: 2022-04-12 09:56
 */
@RestController
@RequestMapping("/student/classes")
public class SClassesController extends BaseController<SClassesService, SClasses>{


    @GetMapping("/home")
    public ModelAndView home(){
        ModelAndView modelAndView = new ModelAndView("student/classes/home");
        return modelAndView;
    }

    @GetMapping("/form")
    public ModelAndView form(Integer id){
        ModelAndView modelAndView = new ModelAndView("student/classes/form");
        if (id != null) {
            modelAndView.addObject("entity", service.findById(id));
        }
        return modelAndView;
    }

}
